package edu.hawaii.ics414;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

public class NearbyEventsActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.nearbyevents);
    }

    public boolean onCreateOptionsMenu(Menu menu) {
      MenuInflater inflater = getMenuInflater();
      inflater.inflate(R.menu.menu, menu);
      return super.onCreateOptionsMenu(menu);
    }
    
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

      super.onOptionsItemSelected(item);
      
      switch (item.getItemId()) {
      case R.id.home:
        Intent main = new Intent(getApplicationContext(), MainActivity.class);
        main.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        finish();
        startActivity(main);
        break;

      case R.id.calendar:
        Intent calendar = new Intent(getApplicationContext(), CalendarActivity.class);
        calendar.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        finish();
        startActivity(calendar);
        break;

      /*case R.id.nearbyevents:
        Intent nearbyEvents = new Intent(getApplicationContext(), NearbyEventsActivity.class);
        nearbyEvents.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        finish();
        startActivity(nearbyEvents);
        break;

      case R.id.info:
        Intent info = new Intent(getApplicationContext(), InfoActivity.class);
        info.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        finish();
        startActivity(info);
        break;*/

      }
      return true;
    }
}
